package com.drugmanage.dao;

import com.drugmanage.Base.BaseDao;
import com.drugmanage.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;

public interface UserDao extends BaseDao<User>{

    @Select("select * from dm_user where username = #{name}")
    User queryByUserName(String name);

    @Select("select * from dm_user where mobile = #{mobile}")
    User queryByMobile(String mobile);

    @Update("update dm_user set pwd = #{pwd},updateDate = #{updateDate} where id = #{userId}")
    void updateUserPwd(@Param("pwd") String pwd, @Param("updateDate") Date updateDate,@Param("userId") Integer userId);

    @Select("Select userName from dm_user where id = #{id}")
    String queryUser(Integer id);
}